<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加医院</title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
          name="viewport">
    <link href="/static/layui/css/layui.css" media="all" rel="stylesheet">
    <link href="/static/admin/style/admin.css" media="all" rel="stylesheet">
    <style>
        .add_order .layui-form-label {
            width: 130px;
        }
        .add_order .layui-input-block {
            margin-left: 160px;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body add_order">
                    <form action="" class="layui-form" lay-filter="component-form-element">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this">基本信息</li>
                                <li>医院介绍</li>
                                <li>中心介绍</li>
                                <li>专家介绍</li>
                                <li>seo优化</li>
                            </ul>
                            <div class="layui-tab-content" style="padding: 25px 10px;min-height: 700px">
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-row layui-col-space10 layui-form-item">
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">栏目：</label>
                                            <div class="layui-input-block">
                                                <select name="from">
                                                    <option value="1" selected>表单</option>
                                                    <option value="2">电话</option>
                                                    <option value="3">微信</option>
                                                    <option value="4">转介绍</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">医院：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" lay-verify="required" name="title"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">医院别名：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" name="ftitle"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">推荐：</label>
                                            <div class="layui-input-inline" style="width: 150px;">
                                                <select name="firsttitle">
                                                    {volist name="notes.firsttitle" id="vo" key="k"}
                                                    <option {if $k-1 eq 0}selected="selected"{/if} value="{$k-1}">{$vo}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                            <label class="layui-form-label">头条：</label>
                                            <div class="layui-input-inline" style="width: 150px;">
                                                <select name="firsttitle">
                                                    {volist name="notes.isgood" id="vo" key="k"}
                                                    <option {if $k-1 eq 0}selected="selected"{/if} value="{$k-1}">{$vo}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                            <label class="layui-form-label">置顶：</label>
                                            <div class="layui-input-inline" style="width: 150px;">
                                                <select name="firsttitle">
                                                    {volist name="notes.istop" id="vo" key="k"}
                                                    <option {if $k-1 eq 0}selected="selected"{/if} value="{$k-1}">{$vo}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">检查价格：</label>
                                            <div class="layui-input-block" style="width: 120px;">
                                                <input autocomplete="off" class="layui-input" name="price"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">设备型号：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" name="model"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">医院性质：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" name="kind"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">工作时间：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" name="worktime"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">医院地址：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" name="address"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">医院优势：</label>
                                                <div class="layui-input-block">
                                                    <textarea class="layui-textarea" name="hos_advantage" placeholder=""></textarea>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">缩略图：<br>大小：400*280</label>
                                            <a class="layui-btn" id="image" style="float: left;"><i
                                                    class="layui-icon">&#xe67c;</i>上传图片</a>
                                            <div class="layui-input-block" style="margin-left: 295px;">
                                                <input type="text" name="pic" value="" class="layui-input"
                                                       style="position: absolute;left: 0;top: 0;">
                                            </div>
                                            <div class="layui-form-item" style="margin-top: 5px;">
                                                <img style="margin-left: 160px;" id="img" src="" width="200">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">是否发布</label>
                                            <div class="layui-input-inline">
                                                <input type="radio" name="status" value="1" title="是" checked="">
                                                <input type="radio" name="status" value="0" title="否">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md12">

                                                <label class="layui-form-label">医院简介：</label>
                                                <div class="layui-input-block">
                                                    <textarea class="layui-textarea" name="newstext" id="newstext" placeholder=""></textarea>
                                                </div>

                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md12">
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">中心简介：</label>
                                                <div class="layui-input-block">
                                                    <textarea class="layui-textarea" name="center" id="center" placeholder=""></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md12">
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">专家介绍：</label>
                                                <div class="layui-input-block">
                                                    <textarea class="layui-textarea" name="doctor" id="doctor" placeholder=""></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-tab-item">
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-md12">
                                            <label class="layui-form-label">关键词：</label>
                                            <div class="layui-input-block">
                                                <input autocomplete="off" class="layui-input" name="keyboard"
                                                       placeholder="" type="text">
                                            </div>
                                        </div>
                                        <div class="layui-col-md12">
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">描述：</label>
                                                <div class="layui-input-block">
                                                    <textarea class="layui-textarea" name="smalltext" placeholder=""></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-filter="component-form-element" lay-submit>立即提交
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script charset="utf-8" src="/static/admin/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="/static/admin/kindeditor/lang/zh-CN.js"></script>
<link rel="stylesheet" href="/static/admin/kindeditor/themes/default/default.css" />
<script src="/static/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/admin/' //静态资源所在路径
    }).use(['form','laydate','upload','element'], function () {
        var $ = layui.$
            , admin = layui.admin
            , element = layui.element
            , laydate = layui.laydate
            , form = layui.form;

        form.on('submit(component-form-element)', function (data) {

            $.post("{:url('hospital/add')}", data.field, function (res) {

                if (0 == res.code) {

                    layer.msg(res.msg);
                    setTimeout(function () {

                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        window.parent.renderTable();
                    }, 200);
                } else {

                    layer.alert(res.msg, {
                        'title': '添加错误',
                        'icon': 2
                    });
                }
            }, 'json');
            return false;
        });
    });

    KindEditor.ready(function (K) {
var editor1 = K.create('#newstext', {
height: '600px',
    width: '100%',
uploadJson: '/Manage/SolvingProgramme/KindeditorPicUpload',//上传图片后端代码路径
fileManagerJson: '/Manage/SolvingProgramme/KindeditorPicUpload',//上传图片后端代码路径
allowFileManager: true
});

        var editor2 = K.create('#center', {
            width: '100%',
            height: '600px',
            uploadJson: '/Manage/SolvingProgramme/KindeditorPicUpload',//上传图片后端代码路径
            fileManagerJson: '/Manage/SolvingProgramme/KindeditorPicUpload',//上传图片后端代码路径
            allowFileManager: true
        });

        var editor3 = K.create('#doctor', {
            width: '100%',
            height: '600px',
            uploadJson: '/Manage/SolvingProgramme/KindeditorPicUpload',//上传图片后端代码路径
            fileManagerJson: '/Manage/SolvingProgramme/KindeditorPicUpload',//上传图片后端代码路径
            allowFileManager: true
        });

});
</script>
</body>
</html>